PATHMac OS 8 and 9 Developer Documentation > Human Interface Toolbox > Window Manager >

Programming With the Mac OS 8.5 Window Manager


GetWindowBounds

Obtains the size and position of the bounding rectangle of the specified window region.

pascal OSStatus GetWindowBounds (
                     WindowPtr window,
                     WindowRegionCode regionCode,
                     Rect *globalBounds);
window
A value of type WindowPtr . Pass a pointer to the window whose bounds you wish to obtain.
regionCode
A value of type WindowRegionCode . Pass in a constant identifying the window region whose bounds you wish to obtain. Currently, the only valid values for the region code are kWindowStructureRgn and kWindowContentRgn ; see Mac OS 8 Window Manager Reference for descriptions of these and other WindowRegionCode constants.
globalBounds
A pointer to a structure of type Rect . On return, the rectangle contains the dimensions and position, in global coordinates, of the window region specified in the regionCode parameter.
function result
A result code. See Result Codes.
DISCUSSION

When you call the function SetWindowBounds , your application specifies whether the window's content region or its structure region is more important in determining the window's ultimate size and position. This distinction can be important with versions of the Mac OS running the Appearance Manager, since the total dimensions of a window--and, therefore, its spatial relationship to the rest of the screen--may vary from appearance to appearance. Use the GetWindowBounds function to obtain the bounding rectangle for either of these regions for the specified window.

VERSION NOTES

Available with Mac OS 8.5 and later.


© 1999 Apple Computer, Inc. – (Last Updated 18 March 99)